<!DOCTYPE html>
<html>
<head>
    <title>房源分配批量导入</title>
<#include "../common/common.ftl"/>
    <link rel="stylesheet" href="/style/contractForm.css" media="all">
</head>
<body>
<div class="layui-fluid">
    <form class="layui-form" id="batchForm">
        <input type="hidden" name="zsProjectId" value="${(zsProject.id)!}"/>
        <div class="layui-card">
            <div class="layui-card-header">${(zsProject.projectName)!}</div>
            <div class="layui-card-body">
                <div class="layui-form-item">
                    <label class="layui-form-label">
                        房源id：<br/>
                        <span class="jmdf-color-red">[直接从EXCEL中复制即可]</span>
                    </label>
                    <div class="layui-input-block">
                        <textarea class="layui-textarea" lay-verify="required" cols="150" rows="25" name="houseIdStr"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    数据库查询语句(<span class="jmdf-color-red">改一下征收项目id即可使用</span>)：<br/>
                    <span class="jmdf-color-red">注：将查询出的房源id复制到EXCEL中,再全选将房源id复制到以上文本框中即可！</span><br/>
                    SELECT h.id FROM house h WHERE h.house_status = 1 AND h.id IN
                    (SELECT DISTINCT zph.house_id FROM zs_project_house zph WHERE zph.zs_project_id = 5)
                    ORDER BY h.id
                </div>
            </div>
        </div>
        <button style="display: none;" class="layui-btn" id="submitBtn" name="submitBtn" lay-submit="" lay-filter="submit">立即提交</button>
    </form>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['form', 'jquery', 'jmdf', 'verify'], function () {
        var form = layui.form, $ = layui.jquery, jmdf = layui.jmdf, verify = layui.verify, parentIndex = parent.layer.getFrameIndex(window.name);
        //监听提交
        form.on('submit(submit)', function (data) {
            $.ajax({
                url: 'batchFormSave',
                type: 'post',
                data: data.field,//当前容器的全部表单字段，名值对形式：{name: value}
                success: function (data) {
                    if (data.code == "0001") {
                        layer.alert(data.message);
                    } else {
                        layer.msg(data.message, {anim: 6, icon: 2, time: 3000});
                    }
                }
            });
            return false;
        });
    });
</script>
</body>
</html>